//
//  CircleReplyDetailHeaderView.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/4.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "CircleReplyDetailHeaderView.h"

@interface CircleReplyDetailHeaderView ()
{
    GLGWLabel *desLab;
}
@end

@implementation CircleReplyDetailHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        GLGWView *topView = [[GLGWView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeightProportion_In_iPhoneTriploid(48)) inSuperView:self.contentView];
        topView.backgroundColor = [UIColor whiteColor];
        GLGWView *view = [[GLGWView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeightProportion_In_iPhoneTriploid(48)) inSuperView:self.contentView];
        view.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
//        view.backgroundColor = kRandomColor;
        UIRectCorner type = UIRectCornerTopLeft | UIRectCornerTopRight;
        [view setBorderWithCornerRadius:22.0 borderWidth:0 borderColor:[UIColor whiteColor] type:type];

        GLGWLabel *label = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:view];
        label.frame = CGRectMake(kWidthProportion_In_iPhoneTriploid(15), kHeightProportion_In_iPhoneTriploid(21), KScreenWidth, kHeightProportion_In_iPhoneTriploid(22));
        label.centerX = view.centerX;
        desLab = label;
        label.text = @"3条回复";
        label.textAlignment = NSTextAlignmentCenter;
        
        CGFloat deleBtnX = 0;
        CGFloat deleBtnY = kHeightProportion_In_iPhoneTriploid(20);
        CGFloat deleBtnW = kWidthProportion_In_iPhoneTriploid(52);
        CGFloat deleBtnH = kHeightProportion_In_iPhoneTriploid(22);
        GLGWButton *deleBtn = [[GLGWButton alloc] initWithFrame:CGRectMake(deleBtnX, deleBtnY, deleBtnW, deleBtnH) inSuperView:self.contentView];
        [deleBtn setImage:[UIImage imageNamed:@"Qcode_p"] forState:UIControlStateNormal];
        [deleBtn addTarget:self action:@selector(deleteAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return self;
}

- (void)setDesStr:(NSString *)desStr
{
    _desStr = desStr;
    desLab.text = desStr;
}

- (void)deleteAction:(GLGWButton *)sender
{
    if (self.BlockDelete) {
        self.BlockDelete(sender);
    }
}

@end
